package com.ie.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ie.entity.Admins;
import com.ie.entity.Bells;
import com.ie.entity.Pets;
import com.ie.entity.Users;
import com.ie.service.AdminsService;
import com.ie.mapper.AdminsMapper;
import jakarta.annotation.Resource;
import org.apache.catalina.User;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author admin
* @description 针对表【admins】的数据库操作Service实现
* @createDate 2025-03-02 22:16:12
*/
@Service
public class AdminsServiceImpl implements AdminsService{
    @Resource
    private AdminsMapper adminsMapper;

    @Override
    public List<Users> getAllUser() {
        List<Users>  allUser=   adminsMapper.getAllUser();
        System.out.println(allUser);
        return allUser;
    }

    @Override
    public boolean deleteUser(String id) {

        if(adminsMapper.deleteUser(id)>0){
            return true;
        }

        return false;
    }

    @Override
    public List<Admins> searchAdmins() {
        return  adminsMapper.searchAdmins();
    }

    @Override
    public boolean updateAdmins(Admins admins) {

        return adminsMapper.updateAdmins(admins)>0;
    }

    @Override
    public boolean deleteAdmin(String id) {

        return adminsMapper.deleteAdmin(id)>0;
    }

    @Override
    public  List<Pets> getAllPets() {


        return adminsMapper.getAllPets();
    }

    @Override
    public  List<Bells> getAllMessages() {
         return adminsMapper.getAllMessages();

    }

    @Override
    public boolean updateMessage(Bells bells) {

        return adminsMapper.updateMessage(bells)>0;

    }

    @Override
    public boolean deleteMessage(String id) {

        return adminsMapper.deleteMessage(id)>0;
    }

    @Override
    public boolean addAdmins(Admins admins) {
         return adminsMapper.addAdmins(admins)>0;
    }

    @Override
    public List<Users> searchUser(String username) {

        return adminsMapper.searchUser(username);
    }
}




